<template>
    <div ref="board">

    </div>
</template>

<script setup lang="ts">
import { Editor, boardBuilder } from '@/lib/Board';
import { useEditorStore } from '@/stores/EditorStore';
import { storeToRefs } from 'pinia';
import { onMounted, onUpdated, ref } from 'vue';

const board = ref<HTMLDivElement>();
const {editor} = storeToRefs(useEditorStore())
onMounted(()=>{
    const borard:Editor = boardBuilder.createDefaultEditor(board.value!)
    editor.value = borard

    borard.getGraph().bindKey("Delete",()=>{
        borard.getGraph().removeCells(borard.getGraph().getSelectedCells())
    })
})


</script>

<style scoped>

</style>